<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <include file="Inc/basic_css"/>
    <include file="Inc/basic_js"/>
    <import type="js" basepath="__JS__" file="admin" />
    <link rel="stylesheet" type="text/css" href="__PLUGIN__/bootstrap-datepicker/css/datepicker.css" />
    <script type="text/javascript" src="__PLUGIN__/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <style>
        #ClassAdd{width:97%; margin:0 auto; display:none;}/* height:1px; overflow:hidden; */
        #class_title{ padding:10px 0;}
        .time-controler{display: inline-block;overflow: hidden;vertical-align:middle;}
        .time-controler *{float:left}
    </style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN HEADER -->
<include file="Inc/head"/>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <!-- BEGIN SIDEBAR -->
    <include file="Inc/left"/>
    <!-- END SIDEBAR -->
    <!-- BEGIN PAGE -->
    <div class="page-content">
        <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <!-- BEGIN STYLE CUSTOMIZER -->
        <include file="Inc/theme"/>
        <!-- END BEGIN STYLE CUSTOMIZER -->
        <!-- BEGIN PAGE HEADER-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    {$cfg.title}  <small></small>
                </h3>
                <ul class="page-breadcrumb breadcrumb">
                    <li><i class="fa fa-home"></i><a href="{:U('Index/index')}">首页</a> <i class="fa fa-angle-right"></i></li>
                    <li><a href="#">景区设置</a><i class="fa fa-angle-right"></i></li>
                    <li><a href="#">{$cfg.title}</a></li>
                </ul>					<!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="row">
                                <div class="col-lg-10">
                                    <form class="form-inline" name="search" method="get" action="__URL__/index">
                                        <a herf="{:U('Goods/index')}" class="btn dark">全部 <i class="fa fa-list-folder"></i></a>
										<if condition="$cfg.is_class gt 0">
                                        <a href="{:U('NewsClass/index','rid='.$cfg['id'])}" class="btn green">分类管理 <i class="fa fa-list-alt"></i></a>
										</if>
                                        <select class="form-control input-medium" name="sta" >
                                            <option value="" >全部</option>
                                            <option value="0" <?php if($sta == '0'){echo "selected";}?>>未回复</option>
                                            <option value="1" <?php if($sta == '1'){echo "selected";}?>>已回复</option>
                                            
                                        </select>
                                        <input class="form-control input-medium" placeholder="关键词" type="text" name="key" value="{$Think.get.key}">
										<if condition="$cfg.is_class gt 0">
                                        <span id="area_0">
                                        <select class="form-control input-small" name="class_id[]" onchange="javascript:findNext(this.value , 0 , 'area');">
                                            <option value="">请选择分类</option>
                                            <foreach name="classList" item="item">
                                                <option value="{$item.id}">{$item.class_name}</option>
                                            </foreach>
                                        </select>
                                        </span>
										</if>
                                        <!--
                                        <div class="time-controler">
                                            <input class="form-control  form-control-inline input-small date-picker" type="text" data-date-format="yyyy-mm-dd" name="from_time"  value="{$shArray['from_time']?$shArray['from_time']:''}" >
                                            <a class="btn default">To</a>
                                            <input class="form-control  form-control-inline input-small date-picker" type="text" data-date-format="yyyy-mm-dd" name="to_time"  value="{$shArray['to_time']?$shArray['to_time']:''}">
                                        </div>
                                         -->
                                        <input type="submit" value="提交" class="btn blue">
                                    </form>
                                </div>
                        </div>
                    </div>

                    <div role="grid" class="dataTables_wrapper form-inline">
                        <!-- /.row -->
                        <div class="table-scrollable" id="listArea" style="border:0px;">
                            <form method="post" name="myform" id="myform">
                                <table class="table table-striped table-bordered table-advance table-hover">

                                    <thead>
                                    <tr>
                                        <!-- <th align="center"><i class="fa fa-check-square"> 选中</th> -->
                                        <th align="center"><i class="fa fa-sort-numeric-asc"> ID</th>
                                        <th align="center" ><i class="fa fa-tag"> 商品</th>
                                        <th align="center" ><i class="fa fa-tag"> 图片</th>
                                        <th align="center" ><i class="fa fa-star">启用状态</th>
                                        <th align="center" ><i class="fa fa-sort"> 用户名</th>
                                        <th align="center" ><i class="fa fa-star"> 回复状态</th>
                                        <th align="center" ><i class="fa fa-star"> 评论时间</th>
                                        <th align="center" ><i class="fa fa-edit"> 管理操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <foreach name="list" item="item" >
                                        <tr>
                                            <!-- <td align="center"><input type="checkbox" name="id[]" value="{$item.id}" /></td> -->
                                            <td align="center">{$item.id}</td>
                                            <td align="center" class="" name="title_cn" rel="{$item.id}" isfresh="0" para="input"><?php foreach($item['sku'] as $k=>$v){echo $v->attr_key.':'.$v->attr_value."<br>";}?></td>
                                            <td align="center">
                                                <PHP>$pics=json_decode($item['pics'])</PHP>
                                                <volist name="pics" id="vo">
                                                <a title="点击预览" data-toggle="modal" href="#img_preview" onclick="$('#preview').attr('src','__UPLOAD__/{$vo}')"><img src="__UPLOAD__/{$vo}" width="30" height="30" rel="__UPLOAD__/{$vo}" class="preview" /></a>
                                                </volist>
                                            </td>
                                            <td align="center">
                                                <select class="form-control input-small select_color_{$item.status}" name="status" rel="{$item.id}" isfresh="0" para="select">
                                                    <foreach name="statusArr" item="items" key="key">
                                                        <option value="{$key}" <if condition="$key eq $item.status && $item.status neq ''"> selected </if> class="select_color_{$key}">{$items}</option>
                                                    </foreach>
                                                </select>
                                            </td>
                                            <td align="center" class="" name="listorder" rel="{$item.id}" isfresh="1" para="input">{$item.member}</td>
                                            <td align="center" class="" name="listorder" rel="{$item.id}" isfresh="1" para="input"><if condition="$item['relay']">已回复<else />尚未回复</if></td>
                                            <td align="center" class="TextTd" name="listorder" rel="{$item.id}" isfresh="1" para="input">{$item.addtime}</td>
                                            <td align="center">
                                                <div class="zznews">
                                                   
                                                    <a class="btn green  dropdown-toggle" href="{:U('Reply/edit','id='.$item['id'])}" title="查看订单信息">查看评论信息</a>
                                                   <!--  <a class="btn purple  dropdown-toggle" href="{:U('GoodsModel/index','spu_id='.$item['id'])}" title="属性编辑">属性编辑</a>
                                                    <a class="btn yellow  dropdown-toggle" href="{:U('AlbumSku/index','category=Sku&table_id='.$item['id'])}" title="商品相册">商品相册</a>
                                                    <a class="btn blue  dropdown-toggle" href="{:U('Goods/edit','lang=cn&id='.$item['id'])}" title="修改内容">中文编辑</a>
                                                    <a class="btn green  dropdown-toggle" href="{:U('Goods/edit','lang=en&id='.$item['id'])}" title="修改内容">英文编辑</a>
                                                    <a class="btn dark  dropdown-toggle" href="{:U('Goods/edit','lang=jp&id='.$item['id'])}" title="修改内容">日文编辑</a>
                                                    <a class="btn default  dropdown-toggle" href="{:U('Goods/edit','lang=kr&id='.$item['id'])}" title="修改内容">韩文编辑</a>
                                                    <a class="btn red  dropdown-toggle" href="javascript:if(confirm('确实要删除吗?'))location='{:U('Goods/del','id='.$item['id'])}'">删除</a> -->
                                                    </div></td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                </table>
                                <table width="100%" border="0" cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td width="20" align="center" bgcolor="#FFFFFF"><input type="checkbox" id="checkAll" /></td>
                                        <td width="54" align="center" bgcolor="#FFFFFF">批量操作</td>
                                        <td width="1064"  bgcolor="#FFFFFF"><div class="pltime">
                                                <input class="btn red" type="button" name="delete" value=" 批量删除 " onclick="Confirm_ajax('{:U('Goods/del',array('rid'=>$cfg['id']))}','你确认删除选中的条目么？',$('#myform').serialize(),'post')" />
                                                <input class="btn dark" type="button" name="delete2" value="开放状态 " onclick="Confirm_ajax('{:U('Goods/batch?val=1&field=status')}','你确定执行此批量操作么？',$('#myform').serialize(),'post')" />
                                                <input class="btn dark" type="button" name="delete2" value="关闭状态 " onclick="Confirm_ajax('{:U('Goods/batch?val=0&field=status')}','你确定执行此批量操作么？',$('#myform').serialize(),'post')" />
                                                <!--
                                                <input class="btn default" type="button" name="delete2" value="首页推荐 " onclick="Confirm_ajax('{:U('Goods/batch?val=1&field=is_home')}','你确定执行此批量操作么？',$('#myform').serialize(),'post')" />
                                                <input class="btn default" type="button" name="delete2" value="首页隐藏 " onclick="Confirm_ajax('{:U('Reply/batch?val=0&field=is_home')}','你确定执行此批量操作么？',$('#myform').serialize(),'post')" />
                                                <input placeholder="修改发布时间" class="form-control  form-control-inline input-small date-picker" name="addtime" type="text" id="addtime" data-date-format="yyyy-mm-dd" readonly="readonly" maxlength="10"/>
                                                <input class="btn blue" type="button" name="subaddtime" value=" 提交 " onclick="Confirm_ajax('{:U('Reply/addtime')}','确定批量修改时间么？',$('#myform').serialize(),'post')" />
                                                分类：<span id="areaD_0">
                                                <select class="form-control input-small" name="class_id[]" onchange="javascript:findNext(this.value , 0 ,'areaD');">
                                                    <option value="">请选择分类</option>
                                                   <foreach name="classList" item="item">
                                                    <option value="{$item.id}">{$item.class_name}</option>
                                                   </foreach>
                                                </select>
                                               </span>
                                                <input class="btn red" type="button" name="delete" value=" 批量移动 " onclick="Confirm_ajax('{:U('Reply/upClass')}','你确认移动选中的条目么？',$('#myform').serialize(),'post')" />
                                                </div>
                                             -->
                                        </td>
                                </table>
                            </form>
                        </div>
                        <div class="row" id="pageArea">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END PAGE CONTENT -->
    </div>
</div>
<div id="img_preview" class="modal fade modal-scroll" tabindex="-1" data-replace="true" style="display: none;" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">图片预览</h4>
            </div>
            <div class="modal-body">
                <img id="preview" style="width: 540px" alt="" src="">
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn green">Close</button>
            </div>
        </div>
    </div>
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<include file="Inc/foot"/>
<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="__JS__/form-components.js"></script>
<script src="__JS__/app.js" type="text/javascript"></script>
<script src="__JS__/AjaxList.js.php?action=ajaxlistinput&url={:urlencode(U('Reply/ajaxListInput'))}"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    jQuery(document).ready(function() {
        App.init(); // initlayout and core plugins
        FormComponents.init();
    });
    imagePreview();
</script>
<script language="javascript">

    function findNext(v , e , dom){
        var selValue = parseInt(v);
        var areaNextId = parseInt(e+1);
        $("#"+dom+"_"+areaNextId).remove();
        $("#"+dom+"_"+e+" > select > option").each(function(i){
            if($(this).attr('value') == v){
                $(this).attr('selected',true);
            }
        });



        var data = { r: Math.random(),selValue: selValue,areaNextId: areaNextId  ,domId: dom};
        $.ajax({type:"GET", url:"<php>echo U('Reply/ajaxFindNext');</php>",data: data, dataType:"text",async:false,success:function (msg){
        r = msg;
        }});
    if (r==0) {
        return false;
    } else {
        $('#'+dom+'_'+e).append(r);
        return true;
    }


    }

    $(function(){
        {$content}
    });

</script>

<!-- END PAGE LEVEL SCRIPTS -->

</body>
<!-- END BODY -->
</html>
